package com.wanwu.channel.core;

import com.wanwu.channel.core.vo.ChannelPayVo;
import com.wanwu.channel.dao.condition.BaseCondition;
import com.wanwu.channel.dao.entity.ChannelPayEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ChannelPayService
 * @Description 支付表操作相关接口
 * @Author husheng
 * @Date 2020-01-16 19:36
 */
public interface ChannelPayService {

    /**
     * 校验或插入支付表
     * @param pay
     * @return
     */
    ChannelPayVo saveAndCheck(ChannelPayEntity pay);

    /**
     * 根据渠道单号更新预支付流水
     * @param channelPayEntity
     */
    void updateByChannelNo(ChannelPayEntity channelPayEntity);

    /**
     * 更新订单终态
     * @param channelPayEntity
     */
    ChannelPayEntity checkAndUpdateByChannelNo(ChannelPayEntity channelPayEntity);

    /**
     * 根据单号查询支付、报关相关信息，提供海关总署
     *
     * */
    Map selectCustomQryInfoByBizOrderNo(String bizOrderNo, String subOrderNo, String bizCode);

    /**
     * 查询支付单
     * @param bizOrderNo
     */
    ChannelPayEntity qryPayByBizOrderNo(String bizOrderNo,String bizCode);

    /**
     * 支付列表查询
     * @Author hehuangtao
     * @Date 20:57 2020-03-24
     **/
    List<ChannelPayEntity> qryPayList(ChannelPayEntity reqDto, BaseCondition condition);

    /**
     *
     * @param reqDto
     * @param condition
     * @return
     */
    Integer countNum(ChannelPayEntity reqDto, BaseCondition condition);

    ChannelPayEntity selectByOutTradeNoAndPayType(String outTradeNo, int payType);

    ChannelPayEntity queryByBizOrderNo(String outTradeNo,String bizCode);

    ChannelPayEntity queryByBizOrderNoFMaster(String outTradeNo,String bizCode);

    /**
     * @return
     */
    List<ChannelPayEntity> qryMerchantNoEmptyList(Long id);

    /**
     * 通过channelNo查询
     * @param channelNo
     * @return
     */
    ChannelPayEntity queryByChannelNoFMaster(String channelNo);
}
